Repository navigation
Upload the branch version of the website for pull requests - #11
Conversation
001f20f to
1b6e30a
Compare
Also change the main upload action to only execute when the action is not triggered by a PR.
gmantele
left a comment
There was a problem hiding this comment.
It all looks fine to me and it seems to work very well.
Just a question for long term maintenance: what happens when the branch/PR disappear? The corresponding version still stays on the server. Maybe it should be removed when the branch disappear, isn't it?
The versions would just stay there. We leave them on Rubin, as you can see here, for example. If we decide that they should be deleted after the corresponding PR is merged to |
|
Ok. I did not want to say we should, but more that it is something we may have to just think now (and later, we can perform the decided action, if needed). But sure, it is perfectly OK with me to do that, if necessary, in another PR ; that's exactly what I had in mind when approving this PR 😉 |
This updates the Github actions so that pull requests will deploy the branch's version of the website to
v/${BRANCH_NAME}under the main site. The base URL is specified using the-bcommand line argument tohugoso that links correctly point to the branch version site instead of the main one.The Github action files were renamed to be clearer and more concise. The
build_mainaction will update the main site on merges tomain. Thebuild_versionaction deploys a pull request's branch changes as described above. The steps for the main workflow were simplified, as the versioned sites are deployed using a totally separate action now, and the dry-run configuration was no longer required.Additionally, I have added a Github action to setup the
hugotool by downloading and adding it to a cache, so that it can be reused in different workflows without requiring setup from scratch every time.Changes were tested on this branch where I verified that the links look correct and point to the versioned site instead of the main site.
The new, simplified workflow for deploying the main site won't trigger until the PR is merged.